package com.neu.cloudfactory.repository;

import com.neu.cloudfactory.bean.Capacity.Capactity;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface CapactityRepository extends JpaRepository<Capactity,Integer> {
    List<Capactity> findAllByEquipmentidAndFactoryid(Integer equipmentid,Integer factoryid);
    List<Capactity> findAllByFactoryidAndProductid(Integer factoryid,Integer productid);
    Optional<Capactity> findByEquipmentidAndFactoryidAndProductid(Integer equipmentid,Integer factoryid,Integer productid);
    List<Capactity> findAllByEquipmentid(Integer equipmentid);
    void deleteAllByEquipmentid(Integer equipmentid);
    boolean existsByProductid(Integer productid);
    void deleteAllByProductid(Integer productid);
}
